//package org.yscz.mqtt;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.stereotype.Component;
//
//import java.util.concurrent.TimeUnit;
//
///**
// * mqtt发布
// */
//@Component
//public class MqttConsumer implements ApplicationRunner {
//
//    @Autowired
//    private MqttCustomClient customClient;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        for (int i = 0; i < 100; i++) {
//            customClient.publish("yu", "msg：" + i);
//            //System.out.println("push:" + i);
//            try {
//                TimeUnit.SECONDS.sleep(5);
//            }catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//        }
//    }
//}
